package com.ricchieri.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
@Table(name="operationTotalAmount")
public class OperationTotalAmount extends BaseEntity{
	private static final long serialVersionUID = -8561946237800650772L;
		
	@Column(name="totalAmount", nullable=false)
	private Double totalAmount;

	@OneToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "operation", nullable = false)
	private Operation operation;	
	
	public Double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(Double totalAmount) {
		this.totalAmount = totalAmount;
	}

	public Operation getOperation() {
		return operation;
	}

	public void setOperation(Operation operation) {
		this.operation = operation;
	}
}